package com.sensePlusVR.utils;

import android.annotation.SuppressLint;
import android.app.ActivityManager;
import android.content.Context;

@SuppressLint("NewApi")
public class MemoryInfoUtil {
	public static long getAvailMemory(Context context) {
		ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
		ActivityManager.MemoryInfo mi = new ActivityManager.MemoryInfo();
		am.getMemoryInfo(mi);
		return mi.availMem / Constant.BYTE_CONVERSION_MB;
	}
	
	public static long getTotalMemory(Context context) {
		ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
		ActivityManager.MemoryInfo mi = new ActivityManager.MemoryInfo();
		am.getMemoryInfo(mi);
		return mi.totalMem / Constant.BYTE_CONVERSION_MB;
	}
}
